// import proFetch from "../../../../../public/functions/project-fetch";
import {hrAjax as ajax} from 'src/hrpub/common/utils/utils';

export default function getAgreementType(a) {

    const {index} = this.state; // index: 多语

    return ajax({
        url: '/nccloud/hrcm/agreement/AgreementTypeQueryAction.do',
        body: {
            index: index,
            appCode: this.config && this.config.appcode
        },
    }).then((res) => {
        if (res.success) {
            let dataArr, data = res.data;
            if(typeof(data) === 'string'){
                dataArr = JSON.parse(data);
            }else{
                dataArr = data;
            }
            this.setState({
                dataList: dataArr,
                agreementType: dataArr&& dataArr[0].code
            })
        }
    });
}
